<template>
	<div>
		<el-button @click="handleClick('manage')" :type="activeName == 'manage' ? 'primary' : ''">考试管理</el-button>
		<el-button @click="handleClick('create')" :type="activeName == 'create' ? 'primary' : ''">创建考试</el-button>
		<div class="wrap">
			<component :is="activeName" />
		</div>
	</div>
</template>
<script>
export default {
	components: {
		manage: () => import('./List.vue'),
		create: () => import('./Add.vue'),
		examLog: () => import('./ExamLog.vue')
	},
	computed: {
		activeName() {
			return this.$store.state.question.activeName;
		}
	},
	mounted() {
		this.handleClick('manage');
	},
	methods: {
		handleClick(v) {
			this.$store.commit('SET_ACTIVENAME', v);
			this.$store.commit('SET_ACTIVEROW', {});
		}
	}
};
</script>
<style scoped lang="scss">
.wrap {
	padding: 20px 0px;
	max-height: 700px;
	overflow-y: auto;
}
</style>
